import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

// Components of business.
import { HeroListComponent } from './hero-list/hero-list.component';
import { HeroDetailComponent } from './hero-detail/hero-detail.component';

const heroRoutes: Routes = [
  { path: 'heroes', component: HeroListComponent },
  { path: 'heroes/add', component: HeroDetailComponent },
  { path: 'hero/:id', component: HeroDetailComponent },
];


@NgModule({
  imports: [
    RouterModule.forChild(heroRoutes)
  ],
  exports: [
    RouterModule
  ]
})

export class HeroRoutingModule { }



